package com.assignwork.service.impl;

import com.assignwork.dto.ThroughputForecastHuadongDTO;
import com.assignwork.vo.ThroughputForecastHuadongVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springblade.core.mp.base.BaseServiceImpl;
import com.assignwork.entity.ThroughputForecastHuadong;
import com.assignwork.mapper.ThroughputForecastHuadongMapper;
import com.assignwork.service.IThroughputForecastHuadongService;

import java.util.List;

/**
 * (ThroughputForecastHuadong)表服务实现类
 */
@AllArgsConstructor 
@Service("throughputForecastHuadongService")
public class ThroughputForecastHuadongServiceImpl extends BaseServiceImpl<ThroughputForecastHuadongMapper, ThroughputForecastHuadong> implements IThroughputForecastHuadongService {

    @Override
    public IPage<ThroughputForecastHuadongVO> pageVO(BladeUser bladeUser, IPage page, ThroughputForecastHuadongDTO dto) {
        List<ThroughputForecastHuadongVO> ls = baseMapper.pageVO(page, dto);
        for (ThroughputForecastHuadongVO l : ls) {
            l.setImpExpName(DictBizCache.getValue("ie_type", l.getImpExp()));
            l.setTradeTypeName(DictBizCache.getValue("trade_type", l.getTradeType()));
            l.setPeriodTenDaysName(DictBizCache.getValue("period_ten_days", l.getPeriodTenDays()));
        }
        return page.setRecords(ls);
    }

    @Override
    public ThroughputForecastHuadongVO statisticsThroughputForecastHistory(BladeUser bladeUser, ThroughputForecastHuadongDTO dto) {
        return baseMapper.statisticsThroughputForecastHistory(dto);
    }
}
